<?php 
   error_reporting(0);
    define('__ROOT__', dirname(dirname(__FILE__)));
    require_once(__ROOT__.'\config\config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Home | E-Shopper</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/main.css" rel="stylesheet">
	<!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->       
    <link rel="shortcut icon" href="images/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="images/ico/apple-touch-icon-57-precomposed.png">
</head><!--/head-->

<body>
	<header id="header"><!--header-->
            <?php
                if(empty($_SESSION))
                    session_start ();
                if(isset($_SESSION['email']))                  
                    require_once (__ROOT__.'/view/header_login_succeed.php');                
                else{
                    require_once (__ROOT__.'/view/header_login.php');
                }
            ?>
	</header><!--/header-->
	
	
	<section id="cart_items">
		<div class="container">
			<div class="table-responsive cart_info">
				<table class="table table-condensed">
					<thead>
						<tr class="cart_menu">
							<td class="image">Sản Phẩm</td>
							<td class="description"></td>
							<td class="price">Giá</td>
							<td class="quantity">Số Lượng</td>
							<td class="total">Tổng Tiền</td>
							<td></td>
						</tr>
					</thead>
                                        <?php 
                                            $items_total = 0;
                                            if(!empty($_SESSION['cartitem'])){
                                                require_once (__ROOT__.'/view/cart_products.php');
                                                foreach($_SESSION['cartitem'] as $v)
                                                {
                                                    $items_total += ($v['price']*$v['quantity']);
                                                }          
                                            }
                                        ?>
				</table>
			</div>
		</div>
	</section>
	<section id="do_action">
		<div class="container">
			<div class="row">
				<div class="col-sm-6">
					<div class="total_area">
						<ul>
							<li>Tiền Ship <span>Free</span></li>
							<li>Tổng Tiền <span><?php echo number_format($items_total , 0, ',', '.'); ?> Đồng</span></li>
						</ul>
							<a class="btn btn-default check_out" href="<?php echo HOST ?>controller/checkout_controller.php?cost=<?php echo $items_total; ?>">ĐẶT HÀNG</a>
					</div>
				</div>
			</div>
		</div>
	</section><!--/#do_action-->
	<?php  require_once (__ROOT__.'\view\footer.php'); ?>
	

  
    <script src="../js/jquery.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<script src="../js/jquery.scrollUp.min.js"></script>
    <script src="../js/jquery.prettyPhoto.js"></script>
    <script src="../js/main.js"></script>
</body>
</html>